package com.mjlf.mjatis.mapper;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mjlf.mjatis.alias.Alias;
import com.mjlf.mjatis.alias.AliasUtils;
import com.mjlf.mjatis.config.Configuration;
import lombok.extern.java.Log;

import java.util.Collections;
import java.util.Set;

/**
 * @ClassName MapperParser
 * @Author mjlft
 * @Date 2020/5/29 22:46
 * @Version 1.0
 * @Description Mapper解析类
 */
@Log
public class MapperParser {
    /**
     * 解析Mapper
     */
    public void parseConfig(JSONArray mapperArray, Configuration configuration){
        MapperUtil.parse(mapperArray, configuration);
    }

    public void parseConfig(JSONObject mapperJson, Configuration configuration){
        MapperStatement mapperStatement = MapperUtil.parse(mapperJson, configuration);
        configuration.getMapperStatements().put(mapperStatement.getNamespace(), mapperStatement);
    }

    public void parseConfig(String basePackagePath, Configuration configuration){

    }
}
